function modificar(){
Ext.Loader.setConfig({
    enabled: true
});
Ext.Loader.setPath('Ext.ux', '../ux');

Ext.require([
    'Ext.selection.CellModel',
    'Ext.grid.*',
    'Ext.data.*',
    'Ext.util.*',
    'Ext.state.*',
    'Ext.form.*',
    'Ext.ux.CheckColumn'
]);

Ext.onReady(function(){

    function formatDate(value){
        return value ? Ext.Date.dateFormat(value, 'M d, Y') : '';
    }

    Ext.define('User', {
    extend: 'Ext.data.Model',
    fields: [
			{name: 'user_id',  type: 'int'},
			{name: 'username',   type: 'string'},
			{name: 'name',   type: 'string'},
			{name: 'apellido',   type: 'string'},
			{name: 'email',   type: 'string'},
			{name: 'telefono',  type: 'int'},			
        ]
});


    // create the Data Store
    var store = Ext.create('Ext.data.Store', {
        // destroy the store if the grid is destroyed
        autoDestroy: true,
        model: 'User',
        proxy: {
            type: 'ajax',
            // load remote data using HTTP
            url: '/consulta_usuario',
            // specify a XmlReader (coincides with the XML format of the returned data)
            reader: {
                type: 'json',
                root: 'usuarios',
                // records will have a 'plant' tag
                record: 'plant'
            }
        },
        sorters: [{
            property: 'common',
            direction:'ASC'
        }]
    });

    var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
        clicksToEdit: 1
    });

    // create the grid and specify what field you want
    // to use for the editor at each header.
    var grid = Ext.create('Ext.grid.Panel', {
        store: store,
        columns: [{
                text: 'ID',
                width: 40,
                sortable: true,
                dataIndex: 'user_id'
            },{
                header: 'Usuario',
                flex: 1,
                sortable: true,
                dataIndex: 'username',
                field: {
                    type: 'textfield'
                }
            },{
                header: 'Nombre',
                flex: 1,
                sortable: true,
                dataIndex: 'name',
                field: {
                    type: 'textfield'
                }
            },{
                header: 'Apellido',
                flex: 1,
                sortable: true,
                dataIndex: 'apellido',
                field: {
                    type: 'textfield'
                }
            },{
                header: 'Email',
                flex: 1,
                sortable: true,
                dataIndex: 'email',
                field: {
                    type: 'textfield'
                }
            },{
                header: 'Telefono',
                flex: 1,
                sortable: true,
                dataIndex: 'telefono',
                field: {
                    type: 'textfield'
                }
            }],
        selModel: {
            selType: 'cellmodel'
        },
        renderTo: 'editor-grid',
        width: 600,
        height: 300,
        title: 'Edit Plants?',
        frame: true,
        tbar: [{
            text: 'Add Plant',
            handler : function(){
                // Create a model instance
                var r = Ext.create('Plant', {
                    common: 'New Plant 1',
                    light: 'Mostly Shady',
                    price: 0,
                    availDate: Ext.Date.clearTime(new Date()),
                    indoor: false
                });
                store.insert(0, r);
                cellEditing.startEditByPosition({row: 0, column: 0});
            }
        }],
        plugins: [cellEditing]
    });

    // manually trigger the data store load
    store.load({
        // store loading is asynchronous, use a load listener or callback to handle results
        callback: function(){
            Ext.Msg.show({
                title: 'Store Load Callback',
                msg: 'store was loaded, data available for processing',
                modal: false,
                icon: Ext.Msg.INFO,
                buttons: Ext.Msg.OK
            });
        }
    });
});


}
